---@class replica_components
---@field mod_pono_diving replica_mod_pono_diving

---@class replica_mod_pono_diving
---@field inst ent
---@field isdiving netvar
local mod_pono_diving = Class(

---@param self replica_mod_pono_diving
---@param inst ent
function(self, inst)
    self.inst = inst
    self.isdiving = net_bool(inst.GUID, "mod_pono_diving.isdiving", 'mod_pono_diving_isdiving_dirty')
    
    -- 客户端监听潜水状态变化
    if not TheWorld.ismastersim then
        inst:ListenForEvent("mod_pono_diving_isdiving_dirty", function()
            if self:IsDiving() then
                inst:AddTag("pono_is_diving")
            else
                inst:RemoveTag("pono_is_diving")
            end
        end)
    end
end)

function mod_pono_diving:SetIsDiving(value)
    self.isdiving:set(value)
end

function mod_pono_diving:IsDiving()
    return self.isdiving:value()
end

return mod_pono_diving